/**
 * 1、如何把整数从左到右按照k个数拆分？ substring(i,j+k) [i,i+k)
 * 2、把num变成字符：(num+"")
 * 3、字符转回为数字：Integer.valueof
 */
class Solution2268 {
    public int divisorSubstrings(int num, int k) {
        int count = 0;
        int n = (num + "").length();
        for (int i = 0; i <= n - k; i++) {
            Integer value = Integer.valueOf((num + "").substring(i, i + k));
            if (value != 0 && num % value == 0)
                count++;
        }
        return count;
    }

    public static void main(String[] args) {
        int i = new Solution2268().divisorSubstrings(240, 2);
        System.out.println(i);
    }
}
